{extend name="public:base"}
{block name='css'}
<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
<style>
    .col-sm-3{width: 100%;}
</style>
{/block}
{block name="js"}
<script>
    function closeOrder(self){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('真的要关闭该订单吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            myRequestRefresh(self, "{:url('state')}", {id:{$info.id},state:9});
        }, function(){

        });
    }

    function sendOutGoods(self){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('您确定已经发出货物了吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            myRequestRefresh(self, "{:url('state')}", {id:{$info.id},state:3});
        }, function(){

        });
    }
</script>
{/block}
{block name="body"}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单详情信息</h5>
                    <div class="ibox-tools">
                        <a href="javascript:window.history.back();" class="btn btn-sm btn-primary pull-right m-t-n-xs">返回 <i class="fa fa-level-up"></i></a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="zy-fieldk">
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>订单号：</span>
                            <p>{$info.sn}</p>
                        </div>
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>下单人：</span>
                            <p>{$info.nickname}/{$info.code}</p>
                        </div>
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>订单状态：</span>
                            <p>{$info.state}</p>
                        </div>
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>订单总金额：</span>
                            <p>￥{$info.total_amount}</p>
                        </div>
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>支付方式：</span>
                            <p>{$info.pay_way|get_pay_way}</p>
                        </div>
                        <!-- <div class="col-sm-3 zy-fieldinfo">
                            <span>订单类型：</span>
                            <p>{eq name='info.type' value='1'}线上订单{else/}线下订单{/eq}</p>
                        </div> -->
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>创建时间：</span>
                            <p>{$info.create_time}</p>
                        </div>
                        {notempty name='info.remark'}
                        <div class="col-sm-3 zy-fieldinfo">
                            <span>备注：</span>
                            <p>{$info.remark}</p>
                        </div>
                        {/notempty}
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>订购商品信息</h5>
        </div>
        <div class="ibox-content ">
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>图片</th>
                        <th>名称</th>
                        <!-- <th>规格</th> -->
                        <th>单价</th>
                        <th>数量</th>
                        <th>合计</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name='info.goods_list' id='vo'}
                    <tr>
                        <td><a href="{$vo.img}" target="_blank"><img src="{$vo.img}" style="width:40px;height:40px;"></a></td>
                        <td>{$vo.title}</td>
                        <!-- <td>{$vo.spec}</td> -->
                        <td>￥{$vo.price}</td>
                        <td>{$vo.num|floatval=###}</td>
                        <td>￥{php}echo $vo['price']*$vo['num'];{/php}</td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>收货地址</h5>
        </div>
        <div class="ibox-content ">
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th>收货人</th>
                        <th>联系电话</th>
                        <!-- <th>省市区</th> -->
                        <th>详细地址</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>{$info.name|default=''}</td>
                        <td>{$info.phone|default=''}</td>
                        <!-- <td>{$info.sca_name|default=''}</td> -->
                        <td>{$info.address|default=''}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    {eq name='info.status' value='1'}
                    <a href="javascript:;" onclick="closeOrder(this)" class="btn btn-w-m btn-danger">关闭订单</a>
                    {/eq}
                    {eq name='info.status' value='2'}
                    <a href="javascript:;" onclick="sendOutGoods(this)" class="btn btn-w-m btn-primary">发货</a>
                    {/eq}
                </div>
            </div>
        </div>
    </div>
</div>

</body>
{/block}